<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input type="text" v-model="mes" @keyup.enter="getm">
    <h2> {{ mes }}</h2>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var app=new Vue({
        el:"#app",
        data:{
                mes:"啪嗒"
        },
        methods:{
            getm:function () {
                alert(this.mes)
            }
        }

    })

</script>
</body>
</html>